<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/jquery.spinner.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/common_header.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/common_bottom.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/content.css"/>
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/Home/js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/Home/js/index.js"></script>
	<!--<script type="text/javascript" src="<?php echo __PUBLIC__?>/Home/js/Content.js"></script>-->
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/Home/js/magnifier.js"></script>
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/Home/js/jquery.spinner.js"></script>
	</head>
	<body>
	<!--引入公共头部-->
	<!--顶部登陆-->
	<div class="page_top_nav_long">
		<div class="page_top_nav">
			<!--顶部左边-->
			<ul class="page_top_nav_l">
				<li class="s-hw" style="background-image: none;padding-left: 0px;"><a href="index.html" style="padding-left: 0px;">华为官网</a></li>
			</ul>
			<!--顶部右边-->
			<ul class="page_top_nav_r">
				                
				<!--如果有登陆，才显示-->
				<li style="display: list-item;" class="s-user hide" id="login_status">
					<div class="s-dropdown">
						<div class="h">
							<a href="user.html" id="customer_name" rel="nofollow" timetype="timestamp" class="link-user">346269228@qq.com</a>
							 <em class="vip-state" id="vip-info">
								<a href="#" title="VMALL V0会员" id="vip-Active"><i class="icon-vip-level-0"></i>&nbsp;</a>
							</em>
							<s></s>
						</div>
						<div class="b">
							<p><a href="user.html"  id="user-center">我的华为帐号</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://127.0.0.1/testphp/Hdphp-huawei/index.php?m=Home&c=Login&a=out">退出</a></p>
						</div>
					</div>
				</li>
								<li>
					<a href="http://127.0.0.1/testphp/Hdphp-huawei/index.php?m=Home&c=User&a=index" class="page_top_nav_r_a">我的订单</a>
				</li>
			</ul>	
		</div>
	</div>
	<!--顶部登录结束-->
	<!--头部logo开始-->
	<div class="header_long">
		<div class="header">
			<!--logo-->
			<div class="logo">
				<a href="index.html"><img src="http://127.0.0.1/testphp/Hdphp-huawei/Public/Home/images/newLogo.png"/></a>
			</div>
			<!--搜索-->
			<div class="search">
				<div class="form_body">
					<form action="http://127.0.0.1/testphp/Hdphp-huawei/index.php?m=Home&c=Lists&a=search" method="post">
						<input type="text" name="name" id="search_text" value="" placeholder="iphone7"/>
						<input type="submit" value="搜索" id="searcg_botton"/>
					</form>
				</div>
			</div>
			<div class="header_toolbar">
				<div class="header_my_shop">
					<div class="i-mall">
						<div class="h">
							<a href="user.html">我的商城</a>
							<i></i>
							<s></s>
						</div>
					</div>
				</div>
				<div class="header_my_shoppingcar">
					<div class="h" id="header-toolbar-minicart-h">
						<a href="http://127.0.0.1/testphp/Hdphp-huawei/index.php?m=Home&c=Cart&a=index">我的购物车
																	<!--如果购物车里面有数据-->
																	<span><em id="header-cart-total">0</em><b></b></span>
													</a><i></i><s></s><u></u>
					</div>
					<div class="header-toolbar-minicart-content">
												<!--如果购物车是空的-->
					<div class="minicart-pro-empty" id="minicart-pro-empty">
						<span class="icon-minicart">您的购物车是空的，赶紧选购吧！</span>
					</div>
										</div>
				</div>
			</div>
		</div>
	</div>
	<!--头部logo结束-->
	<!--logo下面的导航-->
	<?php 
//	实例化
	$cateModel = new \Home\Common\Model\Category;
//	调用模型里面的方法，得到数组
	$cateData = $cateModel->getCate();
	 ?>
	<div class="navigation_long">
		<div class="navigation">
			<div class="navigation_l">
				<p>全部商品<i></i></p>
				<!--二级菜单-->
				<ul class="category_box_l">
					<?php foreach ($cateData as $cateSecond_v){?>
			<li class="category_item">
				<div class="category-info">
					<a href="<?php echo U('Lists/index',array('cid'=>$cateSecond_v['cid']))?>" class="category_title"><?php echo $cateSecond_v['cname']?></a>
					<?php foreach ($cateSecond_v['threeSon'] as $three_v){?>
					<a href="<?php echo U('Lists/index',array('cid'=>$three_v['cid']))?>"><?php echo $three_v['cname']?></a>
					<?php }?>
				</div>
				<!--移入li右侧div-->
				<div class="category-panels">
					<ul class="subcate-list">
						<?php foreach ($cateSecond_v['son'] as $son_v){?>
						<li class="subcate-item">
							<a href="<?php echo U('Lists/index',array('cid'=>$son_v['cid']))?>" target="_blank">
								<span><?php echo $son_v['cname']?></span>
							</a>
						</li>
						<?php }?>
					</ul>
				</div>
			</li>
			<?php }?>
		</ul>
		<!--二级菜单结束-->
			</div>
		<!--右侧-->
		<ul class="navigation_r">
			<li style="background: #BA181F;" class="navigation_r_hover">
				<a href="index.php">首页</a>
			</li>
			<?php foreach ($cateData as $nav_v){?>
			<li class="navigation_r_hover">
				<a href="<?php echo U('Lists/index',array('cid'=>$nav_v['cid']))?>" ><?php echo $nav_v['cname']?></a>
			</li>
			<?php }?>
		</ul>	
		</div>
	</div>
	<!--logo下面的导航结束-->
	<!--面包屑  开始-->
	<div class="breadcrumb">
		<a href="index.php">首页</a>>
		<?php foreach ($mianbao['category'] as $mianbao_k=>$mianbao_v){?>
		<a href="index.php"><?php echo $mianbao_v['cname']?></a>
		>
		<?php }?>
		<span><?php echo $mianbao['goods']?></span>
		
	</div>
	<!--面包屑  结束-->
	<!--商品详细  开始-->
	<div class="content">
		<div class="goods-area">
			<div class="goods-area_right">
				<div class="goods-area_right_body">
					<div class="goods-area_right_content">
						<h1 class="goods-name"><?php echo $goodData['gname']?></h1>
						<div class="goods-advertise">金属机身，优雅弧屏，”薄“动心弦；1300万后置摄像头, 蓝宝石镜片，专业相机模式；智能指纹，指关节2.0，随心掌控；手机刷卡，芯片级安全；超强内核，智能生活，可圈可点！</div>
						<div class="goods_price">
							<label price="<?php echo $goodData['shop_price']?>">华&nbsp;为&nbsp;&nbsp;价：</label><b>¥</b>&nbsp;&nbsp;<b class="jiage"> <?php echo $goodData['shop_price']?></b>
						</div>
						<div class="goods_code">
							<label>商品编码：</label><span><?php echo $goodData['artnum']?></span>
						</div>
						<div class="goods_evaluate">
							<label>商品评分：</label>
							<span class="goods_star">
								<span>
									<s style="width: 96%;"></s>
								</span>
							</span>
							(
							<a href="" class="goods_comments">
								共 <span style="color: red;"><?php echo $goodData['click']?></span>人查看
							</a>
							)
						</div>
						<div class="goods_freight">
							<label>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</label>
							满 99 免运费
						</div>
						<div class="goods_service">
							<label>服&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;务：</label>
							由华为商城负责发货，并提供售后服务
						</div>
						<div class="choose_standard ">
							<?php foreach ($newGoodsAttr as $GoodsAttr_v){?>
							<dl>
								<dt>选择<?php echo $GoodsAttr_v[0]['taname']?>：</dt>
								<dd>
										<?php foreach ($GoodsAttr_v as $Attr_k=>$Attr_v){?>
										 <!--<?php if($Attr_k==0){?>
                class="choose_click" 
               <?php }?>-->
										<li gaid="<?php echo $Attr_v['gaid']?>" gid="<?php echo $Attr_v['goods_gid']?>"><div><a><?php echo $Attr_v['gavalue']?><s></s></a></div></li>
										<?php }?>
								</dd>
							</dl>
							<?php }?>
						</div>
						<!--点击规格后发送ajax，返回价格，-->
						<script type="text/javascript">
						$(function(){
							//		查询库存  AJAX
								$('.choose_standard dl dd li').click(function(){
									$(this).addClass('choose_click').siblings('li').removeClass('choose_click');
							//		查询class数量
									var len = $('.choose_standard dl dd').find('.choose_click').length;
							//		alert(len);
							//		查询规格种类的数量
									var gg = $('.choose_standard dl').length;
							//		alert(gg);
							//			定义空字符串
										var gaid = '';
										var str = '';
										$.each($(".choose_click"),function(k,v){
											str += $(this).find('a').html() + '&nbsp;';
											gaid += $(this).attr('gaid') + ',';
										})
							//			商品的gid
										var gid = $('.choose_click').attr('gid');
							//			alert(gaid);
							//			原来的价格
										var price = $('.goods_price label').attr('price');
							//			alert(price);
							//			提示，您选择了什么版本
										$('.add_goods_msg b').html(str);
										if(len == gg){
							//			ajax
										$.ajax({
							//				请求地址
											url:"<?php echo U('getAjaxAttr')?>",
							//				发送数据
											data:{gaid:gaid,gid:gid,price:price},
							//				请求类型
											type:'post',
							//				返回的数据类型
											dataType:'json',
							//				成功返回
											success:function(phpData){
//												console.log(phpData);
												var newprice = '';
												if(phpData){
							//						如果有货
							//						newprice += '¥'.phpData.newprice;
													$('.goods_price .jiage').html(phpData.newprice);
													$('.goods_code span').html(phpData.inventory);
													$('.atnum span').html(phpData.artnum);
													$('.addCar').css({'display':'block'});
													$('.Wait').css({'display':'none'});
													$('.text').val(1);
//													放入隐藏于，购物车
												}
							//						没货
												if(phpData==''){
													$('.atnum span').html(0);
													$('.goods_price .jiage').html(price);
													$('.addCar').css({'display':'none'});
													$('.Wait').css({'display':'block'});
												}
											}
										})
									}
								})
						})
						</script>
						<!--点击规格后发送ajax，返回价格等，结束-->
						<div class="goods_quantity">
							<dl class="clearfix">
							<dt>购买数量：</dt>
							<dd>
									<div class="stock-area">
								     <a href="javascript:;" class="icon-minus-2 vam" title="减"></a>
								     <input style="ime-mode: disabled;" class="vam text" value="1" type="text" onfocus=this.blur()>
								     <a href="javascript:;" class="icon-plus-2 vam" title="加" style="background-position: -12px -14px;"></a>
		   						     </div>
		   						     <form action="" method="post">
		   						     	<!--input:hidden*-->
		   						     </form>
		   						     <!--商品数量增加和减少，根据库存，限制商品数量-->
							 <script type="text/javascript">
								$(function(){
									//商品数量加减
									$('.icon-minus-2').click(function(){
										num = $('.text').val();
										if(num<=1){
											num=1;
										}else{
											num= num-1;
										}
										$('.text').val(num);
								})
								$('.icon-plus-2').click(function(){
										num = $('.text').val();
//										获取库存最大数字
										
										num= parseInt(num)+1;
//										1、抓取当前的库存
										var maxnum = $('#artnum_num').html();
//										2、抓取显示商品数量的的text表单
										var artnum = $('.text').val();
//										alert(artnum);
										if(num >=maxnum){
											num = maxnum;
										}
										$('.text').val(num);
//										发送ajax
//										$.ajax({
////											请求地址
//											url : '<?php echo U('ajaxGetNum')?>',
////											发送的数据
//											data:{artnum:artnum,maxnum:maxnum},
////											请求类型
//											type:'post',
////											返回的数据类型
//											dataType:'json',
////											成功返回
//											success:function(phpData){
//												
//											}
//										})
//										
								})
//								让input的text表单不可以编辑
								$('.text').attr('disabled',true);
							})		
							</script>
							</dd>
						</dl>
						
						</div>
					</div>
					<!--库存-->
						<div class="atnum">
							<p>库存: <span id="artnum_num">121</span>台</p>
						</div>
					<!--下边 加入购物车 按钮-->
					<div class="add_goods">
						<div class="add_goods_msg">
							您选择了
							<b></b>
						</div>
						<div class="add_operation">
							<a href="javascript:;" class="addCar"><span>加入购物车</span></a>
							<a href="javascript:;" class="Wait" style="display: none;background-position: 38px -264px;border: 1px solid #FF5C14;background-color: #FF5C14;"><span>暂时无货</span></a>
						</div>
						<script type="text/javascript">
							$(function(){
								$('.addCar').click(function(){
								//		查询class数量
									var len = $('.choose_standard dl dd').find('.choose_click').length;
								//		查询规格种类的数量
									var gg = $('.choose_standard dl').length;	
//									抓取 购买数量
									var num = $('.text').val();
										
									if(len == 0 || len==1){
										alert('请选全规格哦~~');
									}
//									抓取所选规格
									var Cartgaid = '';
									$.each($(".choose_click"),function(k,v){
											Cartgaid += $(this).attr('gaid') + ',';
										})
//									抓取商品的id
									var gid = $('.choose_standard li').attr('gid');
//									发送ajax
									$.ajax({
//										 发送类型
										type:"post",
//										发送地址
										url:"<?php echo U('Cart/addCart')?>",
//										发送的数据
										data:{gid:gid,gaid:Cartgaid,num:num},
//										返回的类型
										dataType:"json",
										success:function(phpdata){
//											console.log(phpdata);
											if(phpdata){
												$('#cart_name').html(phpdata.name);
												$('#cart-total').html(phpdata.total);
												$('#cart-price').html(phpdata.price);
												$('.success_addgoods').css({"display":"block"});
											}
										}
									})
								})
								$('.success_addgoods span,.button-walking').click(function(){
									$('.success_addgoods,.jixu').css({"display":"none"});
								})
							})
						</script>
						<!--加入购物车，成功的提示-->
						<div class="success_addgoods">
							<span></span>
							<i></i>
							<div class="success_addgoods_r">
								<p id="cart_name"><?php echo $goodData['gname']?></p>
								<div class="pro-add-success-msg">成功加入购物车!</div>
								<div class="pro-add-success-total">购物车中共&nbsp;<b id="cart-total"></b>&nbsp;件商品，金额合计&nbsp;¥&nbsp;<b id="cart-price"></b>
								</div>
								<div class="pro-add-success-button">
									<a href="<?php echo U('Cart/index')?>" class="button-style-1 button-go-cart">去结算</a>
									<a class="button-style-4 button-walking" class="jixu">继续逛逛&nbsp;&gt;&gt;</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--左侧 的 放大镜-->
			<div class="goods-area_left">
				<div class="pro-gallery-area">
					<div class="pro-gallery-img">
						<!--***************************-->
						<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/fangdajing.css"/>
<div class="preview">

	<div id="vertical" class="bigImg">
		<img src="<?php echo __ROOT__?>/Upload/magnifier/mid/<?php echo $imgArr[0]?>" width="480" height="480" alt="" id="midimg" />
		<div style="display:none;" id="winSelector"></div>
	</div><!--bigImg end-->
	
	<div class="smallImg">
		<div class="scrollbutton smallImgUp disabled" ></div>
		<div id="imageMenu">
			<ul>
				<?php foreach ($imgArr as $img_v){?>
				<li><img src="<?php echo __ROOT__?>/Upload/magnifier/small/<?php echo $img_v?>" width="68" height="68" alt="洋妞"/></li>
				<?php }?>
			</ul>
		</div>
		<div class="scrollbutton smallImgDown"></div>
	</div><!--smallImg end-->
	<div id="bigView" style="display:none;"><img width="800" height="800" alt="" src="" /></div>
</div>
						<!--**********************************-->
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--商品详细  结束-->
	<!--商品详细介绍，热销榜单    开始-->
	<div class="goods_introduce ">
		<!--左边：热销榜单、最近浏览过的商品-->
		<div class="goods_introduce_l">
			<!--热销-->
			<div class="hot_sell">
				<div class="hot_sell_h">
					<h3>热销榜单</h3>
				</div>
				<div class="hot_sell_b">
					<ul>
						<?php foreach ($hotSell as $hotSell_k=>$hotSell_v){?>
						<li>
							<p class="p-img">
								<a href="#" >
									<img src="<?php echo __ROOT__?>/<?php echo $hotSell_v['lists_pic']?>" width="56" height="56">
								</a>
								<s class="s<?php echo $hotSell_k+1?>"></s>
							</p>
							<p class="p-name">
								<a href="<?php echo U('Content/index',array('gid'=>$hotSell_v['gid']))?>" ><?php echo $hotSell_v['gname']?></a>
							</p>
							<p class="p-price">
								<b>¥<?php echo $hotSell_v['shop_price']?></b>
							</p>
						</li>
						<?php }?>
					</ul>
				</div>
			</div>
			<!--最近浏览过的商品-->
			<!--<div class="history_goods">
			</div>-->
		</div>
		<script type="text/javascript">
			$(function(){
				//商品详细介绍 开始	
				$('.pro-detail-tab-nav ul li').click(function(){
				var num = $(this).index();
				$('.pro-detail-area').eq(num).show().siblings('.pro-detail-area').hide();
				$('.pro-detail-tab-nav ul li').eq(num).addClass('current').siblings('.pro-detail-tab-nav ul li').removeClass('current');
	})
	//商品详细介绍 结束
			})
		</script>
<!--		右边：商品详细信息、评价-->
		<div class="goods_introduce_r">
			<div id="pro-tab-all" class="pro-detail-tool">
				<div class="pro-tab-area">
					<div class="pro-detail-tab-nav">
						<ul>
							<li id="pro-tab-feature" class="current">
								<a href="javascript:;" title="商品详情"><span>商品详情</span></a>
							</li>
							<li id="pro-tab-evaluate">
								<a href="javascript:;" title="商品详情"><span>售后服务</span></a>
							</li>
							<!--<li id="pro-tab-parameter">
								<a href="javascript:;" title="商品详情"><span>用户评价</span></a>
							</li>-->
						</ul>
					</div>
				</div>
			</div>
			<!--产品特称，介绍-->
			<div class="pro-detail-area">
				<div class="pro-tab-feature-content">
					<div>
						<?php echo $goodsDeData['detail']?>
					</div>
				</div>
			</div>
			<!--售后服务-->
			<div class="pro-detail-area" style="display: none;">
				<div class="pro-tab-feature-content">
					<div>
						<p>本产品全国联保，享受三包服务，质保期为：一年质保</p>
						<p>如因质量问题或故障，凭厂商维修中心或特约维修点的质量检测证明，享受7天内退货，15日内换货，15日以上在质保期内享受免费保修等三包服务！</p>
						<p>售后服务电话：400-830-8300</p>
						<p>华为消费者BG官网：<a href="http://www.liangshuo.top">www.liangshuo.top</a></p>
					</div>
				</div>
			</div>
			<!--用户评价-->
			<div class="pro-detail-area" style="display: none;">
				<div class="pro-tab-feature-content">
					<div>
						2
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
						<p><img src="<?php echo __PUBLIC__?>/Home/images/2015092809475392.jpg" alt="" /></p>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--商品详细介绍，热销榜单    结束-->
	<!--引入公共底部-->
	<!--商城宣传-->
	<div class="slogan">
		<ul>
			<li style="width: 326px;"><i></i>500强企业 品质保证</li>
			<li style="width: 327px;"><i></i>7天退货 15天换货</li>
			<li><i></i>99元起免运费</li>
			<li style="float: right;"><i></i>448家维修网点 全国联保</li>
		</ul>
	</div>
	<!--底部友情链接-->
	<div class="footer">
		<div class="footer-otherLink">
			<p>友情链接： | 
				<a href="http://www.houdunwang.com">后盾网</a> | 
				<!--<a href="">华为消费者业务</a>
				<span>|</span>-->
			</p>
			<p></p>
			<p></p>
			<p></p>
			<p></p>
		</div>
		<div class="footer-warrant-area">
			<p>Copyright © 2011-2015  华为软件技术有限公司  版权所有  保留一切权利  苏B2-20130048号 | 苏ICP备09062682号-9</p>
			<p><a href="javascript:;">网络文化经营许可证苏网文[2012]0401-019号</a></p>
			<p class="footer-warrant-img">
				<a href=""><img src="http://127.0.0.1/testphp/Hdphp-huawei/Public/Home/images/certificate_01_112_40.png" alt="" /></a>
				<a href=""><img src="http://127.0.0.1/testphp/Hdphp-huawei/Public/Home/images/certificate_02_112_40.png" alt="" /></a>
				<a href=""><img src="http://127.0.0.1/testphp/Hdphp-huawei/Public/Home/images/certificate_03_112_40.png" alt="" /></a>
			</p>
		</div>
	</div>	
	<script type="text/javascript" src="http://127.0.0.1/testphp/Hdphp-huawei/Public/Home/js/BackTop.js"></script>
	<script type="text/javascript">
			$(function(){
				//插件使用
				$('.goTop').backTop({right:20});
			})
		</script>
	<div class="goTop">
		
	</div>
	
		</body>
</html>
